﻿namespace Amazon.Checkout
{
    using System.Collections.Generic;
    using System.Web.Mvc;
    using System.Web.Routing;

    using Orchard.Mvc.Routes;

    public class Routes : IRouteProvider
    {
        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in this.GetRoutes())
            {
                routes.Add(routeDescriptor);
            }
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            return new[] {
                new RouteDescriptor 
                {
                    Priority = 5,
                    Route = new Route(
                        "Amazon/Results/ThankYou",
                        new RouteValueDictionary { { "area", "Amazon.Checkout" }, { "controller", "Results" }, { "action", "ThankYou" } },
                        new RouteValueDictionary(),
                        new RouteValueDictionary { { "area", "Amazon.Checkout" } },
                        new MvcRouteHandler())
                }
            };
        }
    }
}
